Try to keep Title class as a value object: remove the setNamespace() method. Make...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 21 Nov 2004 09:47:00 +0000 (09:47 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 21 Nov 2004 09:47:00 +0000 (09:47 +0000)
includes/SpecialContributions.php
includes/SpecialUpload.php
includes/Title.php

index aa1da78..875bd25 100644 (file)
@@ -40,7 +40,7 @@ function wfSpecialContributions( $par = '' ) {
                $wgOut->errorpage( 'notargettitle', 'notargettext' );
                return;
        }
-       $nt->setNamespace( Namespace::getUser() );
+       $nt =& Title::makeTitle( NS_USER, $nt->getDBkey() );
 
        $id = User::idFromName( $nt->getText() );
 
index f4fd321..1e3d40c 100644 (file)
@@ -178,7 +178,7 @@ class UploadForm {
                if( is_null( $nt ) ) {
                        return $this->uploadError( wfMsg( 'illegalfilename', htmlspecialchars( $filtered ) ) );
                }
-               $nt->setNamespace( NS_IMAGE );
+               $nt =& Title::makeTitle( NS_IMAGE, $nt->getDBkey() );
                $this->mUploadSaveName = $nt->getDBkey();
                
                /**
index b23dd4b..b017959 100644 (file)
@@ -466,12 +466,6 @@ class Title {
         * @access public
         */
        function getNamespace() { return $this->mNamespace; }
-       /**
-        * Set the namespace index
-        * @param int $n the namespace index, one of the NS_xxxx constants
-        * @access public
-        */
-       function setNamespace( $n ) { $this->mNamespace = IntVal( $n ); }
        /**
         * Get the interwiki prefix (or null string)
         * @return string